#pragma once

#include "pgl/shape/dllexport.h"
class CPGLGeoPointBase:public CPGLLine2D
{
public:
	virtual void SetType(CPGLLine2D::EMarkerType markerType=CPGLLine2D::MarkerTypeCircle)=0;
	virtual void SetSize(float radius)=0;
	template<typename T> void GetX(T& x)
	{
		x=(T)GetXi(0);
	}
	template<typename T> void GetY(T& y)
	{
		y=(T)GetYi(0);
	}
};

template<typename T> class CPGLGeoPoint:public CPGLGeoPointBase
{
private:
	void SetPos(T x,T y)
	{
		std::vector<T> vx(1);
		std::vector<T> vy(1);
		vx[0]=x;
		vy[0]=y;
		SetDatas(vx,vy);
	}
public:
	CPGLGeoPoint()
	{
		SetPos(0,0);
		SetType();
		SetSize();
	};
	CPGLGeoPoint(T x,T y)
	{
		SetPos(x,y);
		SetType();
		SetSize();
	}
	virtual void SetType(CPGLLine2D::EMarkerType markerType=CPGLLine2D::MarkerTypeCircle)
	{
		SetMarkerType(markerType);
	}
	virtual void SetSize(float radius=2)
	{
		SetMarkerWidth(radius);
	}
};

PGLSHAPE_API typedef CPGLGeoPoint<byte> CPGLGeoPointB;
PGLSHAPE_API typedef CPGLGeoPoint<double> CPGLGeoPointD;
PGLSHAPE_API typedef CPGLGeoPoint<float> CPGLGeoPointF;
PGLSHAPE_API typedef CPGLGeoPoint<int> CPGLGeoPointI;
PGLSHAPE_API typedef CPGLGeoPoint<long> CPGLGeoPointL;
PGLSHAPE_API typedef CPGLGeoPoint<short> CPGLGeoPointS;

PGL_DECLARE_SMARTPTR(CPGLGeoPointBase);
PGL_DECLARE_SMARTPTR(CPGLGeoPointB);
PGL_DECLARE_SMARTPTR(CPGLGeoPointD);
PGL_DECLARE_SMARTPTR(CPGLGeoPointF);
PGL_DECLARE_SMARTPTR(CPGLGeoPointI);
PGL_DECLARE_SMARTPTR(CPGLGeoPointL);
PGL_DECLARE_SMARTPTR(CPGLGeoPointS);